package com.woniuxy.dao;

import com.woniuxy.pojo.MerchantCode;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

public interface MerchantCodeMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(MerchantCode record);

    int insertSelective(MerchantCode record);

    MerchantCode selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(MerchantCode record);

    int updateByPrimaryKey(MerchantCode record);
     @Select("select * from merchant_code where telephone= #{telephone}")
    MerchantCode findBytelephone(String telephone);
    @Delete("Delete from merchant_code where telephone= #{telephone}")
    void deleteBytelephone(String telephone);
    @Select("select code from merchant_code where telephone=#{telephone} and createTime>#{createtime}")
    String findCodeBytelephone(MerchantCode merchantCode);
    @Insert("insert into merchant_code(telephone,code,createTime) values(#{telephone},#{code},#{createtime})")
    void addcode(MerchantCode merchantCode);
}